home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume7 / xmail / patch1.02 < prev    next >
Encoding:
Internet Message Format  |  1990-06-01  |  50.7 KB

  1. Path: uunet!aplcen!haven!decuac!decwrl!elroy.jpl.nasa.gov!ames!sun-barr!newstop!sun!news
  2. From: news@sun.Eng.Sun.COM (news)
  3. Newsgroups: comp.sources.x
  4. Subject: v07i082: xmail -- Mail front end for X11, Patch1, Part02/06
  5. Message-ID: <136497@sun.Eng.Sun.COM>
  6. Date: 1 Jun 90 03:40:35 GMT
  7. Organization: Sun Microsystems, Inc. - Mtn View, CA
  8. Lines: 1498
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: parns.nsc.com!michael (Michael C. Wagnitz)
  12. Posting-number: Volume 7, Issue 82
  13. Archive-name: xmail/patch1.02
  14. Patch-To: xmail: Volume 6, Issue 41-46
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then unpack
  18. # it by saving it into a file and typing "sh file".  To overwrite existing
  19. # files, type "sh file -c".  You can also feed this as standard input via
  20. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  21. # will see the following message at the end:
  22. #        "End of archive 2 (of 5)."
  23. # Contents:  Patch.01a
  24. # Wrapped by michael@harley on Tue May 29 10:33:50 1990
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'Patch.01a' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'Patch.01a'\"
  28. else
  29. echo shar: Extracting \"'Patch.01a'\" \(48483 characters\)
  30. sed "s/^X//" >'Patch.01a' <<'END_OF_FILE'
  31. XPrereq: 0
  32. X
  33. X*** ../v1.0/patchlevel.h    Sun May 27 21:05:41 1990
  34. X--- patchlevel.h    Sun May 27 21:49:23 1990
  35. X***************
  36. X*** 1 ****
  37. X! #define PATCHLEVEL 0
  38. X--- 1 ----
  39. X! #define PATCHLEVEL 1
  40. X*** ../v1.0/README    Sun May 27 21:05:34 1990
  41. X--- README    Sun May 27 21:16:33 1990
  42. X***************
  43. X*** 30,36 ****
  44. X     does have some features which I found to be practical.  For one, it
  45. X     provides built in help information on each of the xmail sub-windows.
  46. X     It also supports the user preferred editor when creating messages,
  47. X!    utilizing the value in the user's EDITOR environment variable, if found.
  48. X     Please see the man page for additional details.
  49. X  
  50. X     A non-imake version of a make file is provided as make.file.  You may use
  51. X--- 30,36 ----
  52. X     does have some features which I found to be practical.  For one, it
  53. X     provides built in help information on each of the xmail sub-windows.
  54. X     It also supports the user preferred editor when creating messages,
  55. X!    utilizing the value in the user's VISUAL environment variable, if found.
  56. X     Please see the man page for additional details.
  57. X  
  58. X     A non-imake version of a make file is provided as make.file.  You may use
  59. X*** ../v1.0/HelpText.c    Sun May 27 21:05:36 1990
  60. X--- HelpText.c    Sun May 27 21:09:53 1990
  61. X***************
  62. X*** 29,34 ****
  63. X--- 29,47 ----
  64. X  
  65. X  #include    "global.h"
  66. X  
  67. X+ String    Bcc_Help_Text = "\
  68. X+ Use the Bcc: window to specify blind carbon copy\n\
  69. X+ recipients for this message.  Blind carbon recipient\n\
  70. X+ names are removed from the message prior to delivery.\n\n\
  71. X+ Pressing the right mouse button in this window displays\n\
  72. X+ a list of your aliases.  Releasing the right mouse\n\
  73. X+ button while one of the alias names is highlighted\n\
  74. X+ copies that name into the window, preceeding it with a\n\
  75. X+ comma if needed.\n\n\
  76. X+ Pressing the backspace or delete key erases a previously\n\
  77. X+ entered character.  Control_W (^W) erases a previous\n\
  78. X+ word, Control_U (^U) the entire line.";
  79. X+ 
  80. X  String    Cc_Help_Text = "\
  81. X  Use the Cc: window to specify carbon copy recipients for\n\
  82. X  this message.\n\n\
  83. X***************
  84. X*** 35,67 ****
  85. X  Pressing the right mouse button in this window displays a\n\
  86. X  list of your aliases.  Releasing the right mouse button\n\
  87. X  while one of the alias names is highlighted copies that\n\
  88. X! name into the window, preceeding it with a comma if needed.\n\n\
  89. X  Pressing the backspace or delete key erases a previously\n\
  90. X! entered character.  Control_W (^W) erases a previous word\n\
  91. X! and Control_U (^U) the entire line.\n\n\
  92. X! See also the Subject:, To:, Autograph, and Deliver helps.";
  93. X  
  94. X  String    Copy_Help_Text = "\
  95. X! copy - copies a message into the file or folder named in\n\
  96. X! the File: window, without deleting the original.\n\n\
  97. X! The right button pops up a menu for both the copy and\n\
  98. X! Copy commands.\n\n\
  99. X  The uppercase (Copy) command copies the message to a file\n\
  100. X  whose name is derived from the author of the message,\n\
  101. X  rather than from any name currently in the File: window.\n\n\
  102. X! See also the save command help information.";
  103. X  
  104. X  String    Delete_Help_Text = "\
  105. X! delete - removes a message from the folder, the message\n\
  106. X! to be deleted indicated by selection highlight in the\n\
  107. X! index (top) window.\n\n\
  108. X! The right button pops up a menu for both the delete and\n\
  109. X! undelete commands.\n\n\
  110. X! Undelete restores the most recently deleted message,\n\
  111. X! providing changes have not already been committed.\n\
  112. X! Undelete may be pressed repeatedly to restore all deleted\n\
  113. X! messages.\n\n\
  114. X! See also the hold, save, folder, Newmail, and quit helps.";
  115. X  
  116. X  String    Deliver_Help_Text = "\
  117. X  The Deliver button will complete the currently composed\n\
  118. X--- 48,80 ----
  119. X  Pressing the right mouse button in this window displays a\n\
  120. X  list of your aliases.  Releasing the right mouse button\n\
  121. X  while one of the alias names is highlighted copies that\n\
  122. X! name into the window, preceeded with a comma if needed.\n\n\
  123. X  Pressing the backspace or delete key erases a previously\n\
  124. X! entered character.  Control_W (^W) erases a previous\n\
  125. X! word and Control_U (^U) the entire line.";
  126. X  
  127. X  String    Copy_Help_Text = "\
  128. X! Pressing this button copies the current message to the\n\
  129. X! file or folder named in the File: window, without marking\n\
  130. X! the original for removal.\n\n\
  131. X! The right mouse button pops up a menu for both the copy\n\
  132. X! and Copy commands.\n\n\
  133. X  The uppercase (Copy) command copies the message to a file\n\
  134. X  whose name is derived from the author of the message,\n\
  135. X  rather than from any name currently in the File: window.\n\n\
  136. X! See also the save command for additional information.";
  137. X  
  138. X  String    Delete_Help_Text = "\
  139. X! Pressing this button removes the selected message from the\n\
  140. X! current folder.\n\n\
  141. X! The right mouse button pops up a menu for both the delete\n\
  142. X! and undelete commands.\n\n\
  143. X! Undelete restores the selected message (if it has been\n\
  144. X! marked 'D'eleted), otherwise the deleted message with the\n\
  145. X! smallest message number is restored.\n\n\
  146. X! Undelete may be used repeatedly to restore all deleted\n\
  147. X! messages if changes have not yet been committed.\n\n\
  148. X! See also preserve, save, folder, Newmail, and quit.";
  149. X  
  150. X  String    Deliver_Help_Text = "\
  151. X  The Deliver button will complete the currently composed\n\
  152. X***************
  153. X*** 79,155 ****
  154. X  entered character.\n\n\
  155. X  Control_W (^W) erases the previous word and Control_U (^U)\n\
  156. X  the entire line.\n\n\
  157. X! See also the folder and save commands.";
  158. X  
  159. X  String    Folder_Help_Text = "\
  160. X  The left button changes the active folder to the one\n\
  161. X  specified in the File: window.  Changing folders COMMITs\n\
  162. X  any modifications to the current folder.\n\n\
  163. X! The right button brings up a list of folders from which to\n\
  164. X! choose.\n\n\
  165. X  Clicking the left button on a directory (indicated by\n\
  166. X! trailing slash) while still holding down the right, expands\n\
  167. X! the directory, if it has files.\n\n\
  168. X! Releasing the right button copies the selected name to the\n\
  169. X! File: window.";
  170. X  
  171. X  String    Hold_Help_Text = "\
  172. X! Pressing the hold button marks the selected message for\n\
  173. X! retention in the system mailbox, usually after having\n\
  174. X! first saved it to another file or folder.\n\n\
  175. X! The button is insensitive if not currently in your system\n\
  176. X! mail folder.";
  177. X  
  178. X  String    Index_Help_Text = "\
  179. X! The index window displays a list of mail messages\n\
  180. X! available in the current folder.\n\n\
  181. X  Pressing the left mouse button anywhere on the line marks\n\
  182. X! the message as selected (for other commands) but does not\n\
  183. X! automatically display the selected message.\n\n\
  184. X! Pressing the right button selects and automatically\n\
  185. X  displays the message.\n\n\
  186. X! See also the read command help information.";
  187. X  
  188. X  #ifdef SUNOS_4
  189. X  String    NewMail_Help_Text = "\
  190. X! Newmail - causes user's system mail folder to become the\n\
  191. X! active folder (if mail exists) and includes any new mail\n\
  192. X! that may have been delivered since the program was started.\n\
  193. X! This action commits any changes made to the current folder.\n\n\
  194. X! The button will highlight whenever new mail is available.\n\n\
  195. X! The right mouse button provides a choice between committing\n\
  196. X! changes, or just incorporating new messages without\n\
  197. X! committing changes (but only if the system mailbox is your\n\
  198. X! current folder).";
  199. X  #else
  200. X  String    NewMail_Help_Text = "\
  201. X! Newmail - causes user's system mail folder to become the\n\
  202. X! active folder (if mail exists) and includes any new mail\n\
  203. X! that may have been delivered since the program was started.\n\
  204. X! This action commits any changes made to the current folder.\n\n\
  205. X! The button will highlight whenever new mail is available.\n\n\
  206. X! The right mouse button is a copy of the Newmail command.";
  207. X  #endif
  208. X  
  209. X  String    Print_Help_Text = "\
  210. X! Print - causes the selected message to be printed on the\n\
  211. X! system printer.\n\n\
  212. X! A notice will be displayed in the status window indicating\n\
  213. X! which message was printed, along with its size in bytes.\n\n\
  214. X! See the index help for information on selecting a message.";
  215. X  
  216. X  String    Quit_Help_Text = "\
  217. X  quit - terminates xmail, committing changes made to the\n\
  218. X  current folder.\n\n\
  219. X! The right button pops up a menu for both the quit and exit\n\
  220. X! commands.\n\n\
  221. X  Use exit when you wish to leave xmail without committing\n\
  222. X! folder changes.\n\n\
  223. X  See also the folder, Newmail, and delete commands.";
  224. X  
  225. X  String    Read_Help_Text = "\
  226. X! read - displays the selected message in the text (bottom)\n\
  227. X! window.\n\n\
  228. X  Message selection is indicated by caret and highlight in\n\
  229. X  the index (top) window.\n\n\
  230. X  The right button pops up a menu for reading the message,\n\
  231. X--- 92,179 ----
  232. X  entered character.\n\n\
  233. X  Control_W (^W) erases the previous word and Control_U (^U)\n\
  234. X  the entire line.\n\n\
  235. X! See folder and save commands for additional information.";
  236. X  
  237. X  String    Folder_Help_Text = "\
  238. X  The left button changes the active folder to the one\n\
  239. X  specified in the File: window.  Changing folders COMMITs\n\
  240. X  any modifications to the current folder.\n\n\
  241. X! The right button brings up a list of folders from which\n\
  242. X! to choose.\n\n\
  243. X  Clicking the left button on a directory (indicated by\n\
  244. X! trailing slash) while still holding down the right,\n\
  245. X! expands the directory, if it has files.\n\n\
  246. X! Releasing the right button copies the selected name to\n\
  247. X! the File: window.";
  248. X  
  249. X  String    Hold_Help_Text = "\
  250. X! This command marks the selected message for preservation\n\
  251. X! in the system mailbox.  Although the \"hold\" variable is\n\
  252. X! normally set by xmail (if not explicitly unset by a user)\n\
  253. X! it is now changeable within xmail.  If hold is not set,\n\
  254. X! preserve is used after having saved a message to another\n\
  255. X! file or folder when you still wish to preserve the mail\n\
  256. X! message in your system folder.  (See the mail man page.)\n\n\
  257. X! The right mouse button presents a menu of three mail\n\
  258. X! environment variables that may be altered while in xmail.\n\
  259. X! Commands listed denote what state each variable will be\n\
  260. X! changed to if the appropriate label is highlighted as the\n\
  261. X! mouse button is released.";
  262. X  
  263. X  String    Index_Help_Text = "\
  264. X! The index window displays a list of mail messages in the\n\
  265. X! current folder, as well as the currently selected message.\n\n\
  266. X  Pressing the left mouse button anywhere on the line marks\n\
  267. X! a message as selected (for other commands) but does not\n\
  268. X! automatically display the message in the text window.\n\n\
  269. X! Pressing the right button selects and also automatically\n\
  270. X  displays the message.\n\n\
  271. X! See also the read command for additional help information.";
  272. X  
  273. X  #ifdef SUNOS_4
  274. X  String    NewMail_Help_Text = "\
  275. X! Pressing this button causes your system mail folder to\n\
  276. X! become the current folder (if mail exists) and includes\n\
  277. X! any new mail delivered since the last time your system\n\
  278. X! folder was accessed.  This action COMMITS any changes to\n\
  279. X! the current folder.\n\n\
  280. X! The Newmail button will highlight whenever new mail has\n\
  281. X! been delivered.  The right mouse button provides a\n\
  282. X! choice between committing changes, or just incorporating\n\
  283. X! new messages without committing changes (only if your\n\
  284. X! system mailbox is already your current folder).";
  285. X  #else
  286. X  String    NewMail_Help_Text = "\
  287. X! Pressing this button causes your system mail folder to\n\
  288. X! become the current folder (if mail exists) and includes\n\
  289. X! any new mail delivered since the last time your system\n\
  290. X! folder was accessed.  This action COMMITS any changes to\n\
  291. X! the current folder.\n\n\
  292. X! The Newmail button will highlight whenever new mail has\n\
  293. X! been delivered.  The right mouse button is a duplicate\n\
  294. X! of the Newmail command.";
  295. X  #endif
  296. X  
  297. X  String    Print_Help_Text = "\
  298. X! Pressing this button causes the selected message to be\n\
  299. X! printed on the system printer.\n\n\
  300. X! A message will be displayed in the status window\n\
  301. X! indicating which message was printed, along with its\n\
  302. X! size in bytes.\n\n\
  303. X! See also the index window for help on selecting a message.";
  304. X  
  305. X  String    Quit_Help_Text = "\
  306. X  quit - terminates xmail, committing changes made to the\n\
  307. X  current folder.\n\n\
  308. X! The right mouse button pops up a menu for the quit and\n\
  309. X! exit commands.\n\n\
  310. X  Use exit when you wish to leave xmail without committing\n\
  311. X! the current folder's changes.\n\n\
  312. X  See also the folder, Newmail, and delete commands.";
  313. X  
  314. X  String    Read_Help_Text = "\
  315. X! Pressing this button causes the selected message to be\n\
  316. X! displayed in the text (bottom) window.\n\n\
  317. X  Message selection is indicated by caret and highlight in\n\
  318. X  the index (top) window.\n\n\
  319. X  The right button pops up a menu for reading the message,\n\
  320. X***************
  321. X*** 164,172 ****
  322. X  The right mouse button displays a menu for selecting\n\
  323. X  'reply', 'reply included', 'replyall' (which addresses all\n\
  324. X  recipients of the original mail), or 'replyall included'.\n\
  325. X! The include options automatically copy the original message\n\
  326. X! into the new one.\n\n\
  327. X! See also the send command.";
  328. X  
  329. X  String    Save_Help_Text = "\
  330. X  save - copies a message to the file or folder named in\n\
  331. X--- 188,195 ----
  332. X  The right mouse button displays a menu for selecting\n\
  333. X  'reply', 'reply included', 'replyall' (which addresses all\n\
  334. X  recipients of the original mail), or 'replyall included'.\n\
  335. X! The include options automatically copy the original\n\
  336. X! message into the new one.\n\n\See also the send command.";
  337. X  
  338. X  String    Save_Help_Text = "\
  339. X  save - copies a message to the file or folder named in\n\
  340. X***************
  341. X*** 186,195 ****
  342. X  'send'ing, or 'forwarding a message'.  Forwarding includes\n\
  343. X  the text of the current message in the new one.\n\n\
  344. X  As with the 'reply' command, a dialog box is provided to\n\
  345. X! specify the name of the recipient(s), subject, and who to\n\
  346. X! send copies of this message.  The user presses the\n\
  347. X! 'Deliver' button to complete the operation.\n\n\
  348. X! See also the reply command.";
  349. X  
  350. X  String    Sign_Help_Text = "\
  351. X  You may insert you choice of the two autograph strings\n\
  352. X--- 209,218 ----
  353. X  'send'ing, or 'forwarding a message'.  Forwarding includes\n\
  354. X  the text of the current message in the new one.\n\n\
  355. X  As with the 'reply' command, a dialog box is provided to\n\
  356. X! specify the name of the recipient(s), subject, and to whom\n\
  357. X! to send copies of this message.  Pressing the 'Deliver'\n\
  358. X! button completes the operation.\n\n\
  359. X! See also the reply command for additional information.";
  360. X  
  361. X  String    Sign_Help_Text = "\
  362. X  You may insert you choice of the two autograph strings\n\
  363. X***************
  364. X*** 214,233 ****
  365. X  Pressing the backspace or delete key erases a previously\n\
  366. X  entered character.\n\n\
  367. X  Control_W (^W) erases the previous word and Control_U (^U)\n\
  368. X! the entire line.\n\n\
  369. X! See also the To:, Cc:, Autograph, and Deliver help messages.";
  370. X  
  371. X  String    Text_Help_Text = "\
  372. X  The text window displays the currently selected message.\n\n\
  373. X  The scrollbar may be used to move the displayed text, as\n\
  374. X  necessary.\n\n\
  375. X! See also the index window help on selecting messages.";
  376. X  
  377. X  String    Title_Help_Text = "\
  378. X  The Title window displays the\n\n\
  379. X  program name and version number, along with the\n\n\
  380. X  name of the current mail folder and its message count(s).\n\n\
  381. X! Under release 4 of X11, pressing the left mouse button on\n\
  382. X  the National Semiconductor Corporation logo in the top\n\
  383. X  left corner of the title bar issues a request to iconify\n\
  384. X  this application.";
  385. X--- 237,255 ----
  386. X  Pressing the backspace or delete key erases a previously\n\
  387. X  entered character.\n\n\
  388. X  Control_W (^W) erases the previous word and Control_U (^U)\n\
  389. X! the entire line.";
  390. X  
  391. X  String    Text_Help_Text = "\
  392. X  The text window displays the currently selected message.\n\n\
  393. X  The scrollbar may be used to move the displayed text, as\n\
  394. X  necessary.\n\n\
  395. X! See also the index window for help on selecting a message.";
  396. X  
  397. X  String    Title_Help_Text = "\
  398. X  The Title window displays the\n\n\
  399. X  program name and version number, along with the\n\n\
  400. X  name of the current mail folder and its message count(s).\n\n\
  401. X! Under Release 4 of X11, pressing the left mouse button on\n\
  402. X  the National Semiconductor Corporation logo in the top\n\
  403. X  left corner of the title bar issues a request to iconify\n\
  404. X  this application.";
  405. X***************
  406. X*** 236,247 ****
  407. X  Use the To: window to specify the recipients for this mail\n\
  408. X  message.\n\n\
  409. X  Pressing the right mouse button in this window displays a\n\
  410. X! list of your alias names.  Releasing the right mouse button\n\
  411. X! while one of the alias names is highlighted will copy that\n\
  412. X! name into the window, prepending it with a comma if needed.\n\n\
  413. X  Pressing the backspace or delete key erases a previously\n\
  414. X! entered character.  Control_W (^W) erases the previous word\n\
  415. X! and Control_U (^U) erases the entire line.\n\n\
  416. X! See also the Subject:, Cc:, Autograph, and Deliver helps.";
  417. X  
  418. X  /* HelpText */
  419. X--- 258,269 ----
  420. X  Use the To: window to specify the recipients for this mail\n\
  421. X  message.\n\n\
  422. X  Pressing the right mouse button in this window displays a\n\
  423. X! list of your alias names.  Releasing the right mouse\n\
  424. X! button while one of the names is highlighted will copy\n\
  425. X! that name into the window, prepended with a comma if\n\
  426. X! needed.\n\n\
  427. X  Pressing the backspace or delete key erases a previously\n\
  428. X! entered character.  Control_W (^W) erases the previous\n\
  429. X! word and Control_U (^U) erases the entire line.";
  430. X  
  431. X  /* HelpText */
  432. X*** ../v1.0/Imakefile    Sun May 27 21:05:36 1990
  433. X--- Imakefile    Sun May 27 21:11:33 1990
  434. X***************
  435. X*** 1,16 ****
  436. X  #
  437. X! # Imakefile for xmail 1.0
  438. X  #
  439. X! # Define SUNOS_4 if compiling under Sun OS 4.x - newer directory routines
  440. X! # Define X11R3 if compiling under X11 Release 3 - include file changes in R4
  441. X! # Define XAW_BC if compiling under X11 Release 4 - changes in Xt/Xaw names
  442. X  #
  443. X! #          DEFINES = -DSUNOS_4 -DX11R3
  444. X!           DEFINES = -DSUNOS_4 -DXAW_BC
  445. X!       CDEBUGFLAGS = -g
  446. X!      INSTPGMFLAGS = -s $(INSTBINFLAGS)
  447. X! 
  448. X!   LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB) -lm
  449. X  
  450. X               SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
  451. X              directory.c environs.c handler.c mail.c parser.c \
  452. X--- 1,21 ----
  453. X  #
  454. X! # Imakefile for xmail 1.1
  455. X  #
  456. X! # SUNOS_4 is defined if compiling under Sun OS 4.x - newer directory routines
  457. X  #
  458. X! #if SunOSPlatform && OSMajorVersion >= 4
  459. X!            SUNOS_4 = -DSUNOS_4
  460. X! #endif
  461. X! #
  462. X! # XAW_BC is defined if compiling with X11 Release 4 - changes in Xt/Xaw names
  463. X! #
  464. X! #if ProjectX > 3
  465. X!            XAW_BC = -DXAW_BC
  466. X! #endif
  467. X! #
  468. X!           DEFINES = $(XAW_BC) $(SUNOS_4)
  469. X!           DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  470. X!   LOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  471. X  
  472. X               SRCS = Mailwatch.c HelpText.c actions.c callMail.c callbacks.c \
  473. X              directory.c environs.c handler.c mail.c parser.c \
  474. X*** ../v1.0/Mailwatch.c    Sun May 27 21:05:37 1990
  475. X--- Mailwatch.c    Sun May 27 21:11:33 1990
  476. X***************
  477. X*** 87,92 ****
  478. X--- 87,94 ----
  479. X  #define    flagdown_width    no_mail_width
  480. X  #define    flagdown_height    no_mail_height
  481. X  
  482. X+ #define between(x, i, y)    ((i) < (x) ? (x) : (i) > (y) ? (y) : (i))
  483. X+ 
  484. X  #define REMOVE_TIMEOUT(id) if (!id) ; else XtRemoveTimeOut(id)
  485. X  #ifdef X11R2
  486. X  #define XtReleaseGC(w, gc) XtDestroyGC(gc)
  487. X***************
  488. X*** 261,273 ****
  489. X      if (w->core.height == 0)
  490. X      w->core.height = max(pix_up_h, pix_dn_h);
  491. X  
  492. X!     if (stat(w->mailbox.filename, &stbuf) == 0) {
  493. X!     w->mailbox.last_access = stbuf.st_mtime;
  494. X  
  495. X!     /* set timer */
  496. X      w->mailbox.interval_id = XtAddTimeOut(w->mailbox.update * 1000,
  497. X!     clock_tic, (caddr_t) w);
  498. X!     }
  499. X  }
  500. X  
  501. X  
  502. X--- 263,276 ----
  503. X      if (w->core.height == 0)
  504. X      w->core.height = max(pix_up_h, pix_dn_h);
  505. X  
  506. X!     w->mailbox.flag_up = FALSE;        /* because it hasn't been shown yet */
  507. X  
  508. X!     w->mailbox.last_access = (stat(w->mailbox.filename, &stbuf) == 0) ?
  509. X!                              stbuf.st_atime : 0 ;    /* last accessed */
  510. X! 
  511. X!     /* set status check timer */
  512. X      w->mailbox.interval_id = XtAddTimeOut(w->mailbox.update * 1000,
  513. X!                                             clock_tic, (caddr_t) w);
  514. X  }
  515. X  
  516. X  
  517. X***************
  518. X*** 301,307 ****
  519. X  Display *dpy;
  520. X  Window root;
  521. X  char *file;
  522. X! int *width, *height;
  523. X  {
  524. X      Pixmap bitmap;
  525. X      int status, foo, bar;
  526. X--- 304,310 ----
  527. X  Display *dpy;
  528. X  Window root;
  529. X  char *file;
  530. X! unsigned int *width, *height;
  531. X  {
  532. X      Pixmap bitmap;
  533. X      int status, foo, bar;
  534. X***************
  535. X*** 354,360 ****
  536. X  ** Modified to NOT update the mail file timestamp via utimes(), and to
  537. X  ** ignore state change where mail adds a status record to the message.
  538. X  ** The first elminates collisions with mail during delivery, and the
  539. X! ** second elminates false triggers for new mail.
  540. X  */
  541. X  static void
  542. X  check_mailbox(w, force_redraw)
  543. X--- 357,365 ----
  544. X  ** Modified to NOT update the mail file timestamp via utimes(), and to
  545. X  ** ignore state change where mail adds a status record to the message.
  546. X  ** The first elminates collisions with mail during delivery, and the
  547. X! ** second elminates false triggers for new mail.  The number of times
  548. X! ** the terminal bell is rung is controlled by the same .mailrc resource
  549. X! ** (bell) used by Sunview's mailtool.
  550. X  */
  551. X  static void
  552. X  check_mailbox(w, force_redraw)
  553. X***************
  554. X*** 361,391 ****
  555. X  MailwatchWidget w;
  556. X  Boolean force_redraw;
  557. X  {
  558. X!  int redraw = 0;
  559. X!  struct timeval times[2];
  560. X  
  561. X   if (stat(w->mailbox.filename, &stbuf) < 0) {        /* no mail file */
  562. X      if (w->mailbox.flag_up == TRUE) {
  563. X!        w->mailbox.flag_up = FALSE;
  564. X!        redraw = TRUE;
  565. X         UnsetNewmail(w, NULL, NULL);
  566. X        }
  567. X     } else {
  568. X!     if (stbuf.st_atime >= stbuf.st_mtime &&
  569. X          stbuf.st_atime >= w->mailbox.last_access) {    /* mail was seen */
  570. X         w->mailbox.last_access = stbuf.st_atime;
  571. X         if (w->mailbox.flag_up == TRUE) {
  572. X!           w->mailbox.flag_up = FALSE;
  573. X!           redraw = TRUE;
  574. X            UnsetNewmail(w, NULL, NULL);
  575. X           }
  576. X        } else {
  577. X         if (stbuf.st_size != 0 && 
  578. X!            stbuf.st_mtime > w->mailbox.last_access) {    /* got new mail */
  579. X            w->mailbox.last_access = stbuf.st_mtime;
  580. X-           if (w->mailbox.bell)
  581. X-              XBell(XtDisplay(w), MAILBOX_VOLUME);
  582. X            if (w->mailbox.flag_up == FALSE) {
  583. X               w->mailbox.flag_up = TRUE;
  584. X               redraw = TRUE;
  585. X               XtCallCallbacks(w, XtNcallback, NULL);
  586. X--- 366,401 ----
  587. X  MailwatchWidget w;
  588. X  Boolean force_redraw;
  589. X  {
  590. X!  int        i, redraw = 0;
  591. X!  char        *p = NULL;
  592. X!  struct timeval    times[2];
  593. X  
  594. X   if (stat(w->mailbox.filename, &stbuf) < 0) {        /* no mail file */
  595. X      if (w->mailbox.flag_up == TRUE) {
  596. X!        force_redraw = 0;
  597. X         UnsetNewmail(w, NULL, NULL);
  598. X        }
  599. X     } else {
  600. X!     if (stbuf.st_atime > stbuf.st_mtime &&
  601. X          stbuf.st_atime >= w->mailbox.last_access) {    /* mail was seen */
  602. X         w->mailbox.last_access = stbuf.st_atime;
  603. X         if (w->mailbox.flag_up == TRUE) {
  604. X!           force_redraw = 0;
  605. X            UnsetNewmail(w, NULL, NULL);
  606. X           }
  607. X        } else {
  608. X         if (stbuf.st_size != 0 && 
  609. X!            stbuf.st_mtime >= w->mailbox.last_access) {    /* got new mail */
  610. X            w->mailbox.last_access = stbuf.st_mtime;
  611. X            if (w->mailbox.flag_up == FALSE) {
  612. X+              if (w->mailbox.bell) {
  613. X+                 i = 1;
  614. X+                 if (p = (char *)GetMailrc("bell"))
  615. X+                    sscanf(p, "%d", &i);
  616. X+                 i = between(1, i, 5);
  617. X+                 for (; i > 0; i--)
  618. X+                     XBell(XtDisplay(w), MAILBOX_VOLUME);
  619. X+                }
  620. X               w->mailbox.flag_up = TRUE;
  621. X               redraw = TRUE;
  622. X               XtCallCallbacks(w, XtNcallback, NULL);
  623. X***************
  624. X*** 504,509 ****
  625. X   MailwatchWidget w = (MailwatchWidget) gw;
  626. X  
  627. X   w->mailbox.flag_up = FALSE;
  628. X!  redraw_mailbox(w, NULL);
  629. X  } /* reset_mailbox */
  630. X  
  631. X--- 514,519 ----
  632. X   MailwatchWidget w = (MailwatchWidget) gw;
  633. X  
  634. X   w->mailbox.flag_up = FALSE;
  635. X!  redraw_mailbox(w);
  636. X  } /* reset_mailbox */
  637. X  
  638. X*** ../v1.0/Mailwatch.h    Sun May 27 21:05:38 1990
  639. X--- Mailwatch.h    Sun May 27 21:09:54 1990
  640. X***************
  641. X*** 12,19 ****
  642. X  #ifndef XtNupdate
  643. X  #define XtNupdate    "update"    /* Int: how often to check mail */
  644. X  #endif /* XtNupdate */
  645. X! #define XtNbell        "bell"        /* boolean to ring bell on new mail */
  646. X  #define XtNfile        "file"        /* String:  file name to check */
  647. X  #define XtNup_flag    "up_flag"    /* path to icon file */
  648. X  #define XtNdown_flag    "down_flag"    /* path to icon file */
  649. X  #define XtNmail        "mail"        /* For XtGetValues to get mail info */
  650. X--- 12,21 ----
  651. X  #ifndef XtNupdate
  652. X  #define XtNupdate    "update"    /* Int: how often to check mail */
  653. X  #endif /* XtNupdate */
  654. X! #ifndef XtNfile
  655. X  #define XtNfile        "file"        /* String:  file name to check */
  656. X+ #endif /* Xtfile */
  657. X+ #define XtNbell        "bell"        /* boolean to ring bell on new mail */
  658. X  #define XtNup_flag    "up_flag"    /* path to icon file */
  659. X  #define XtNdown_flag    "down_flag"    /* path to icon file */
  660. X  #define XtNmail        "mail"        /* For XtGetValues to get mail info */
  661. X*** ../v1.0/actions.c    Sun May 27 21:05:42 1990
  662. X--- actions.c    Sun May 27 21:11:34 1990
  663. X***************
  664. X*** 38,62 ****
  665. X   * The following software modules were created and are Copyrighted by National
  666. X   * Semiconductor Corporation:
  667. X   *
  668. X!  *  1. DoAutograph:
  669. X!  *  2. DoCmd:
  670. X!  *  3. DoDone:
  671. X!  *  4. DoNothing:
  672. X!  *  5. DoReply:
  673. X!  *  6. DoSave:
  674. X!  *  7. DoSelected:
  675. X!  *  8. Folder:
  676. X!  *  9. Iconify:
  677. X!  * 10. MyNotify:
  678. X!  * 11. NextField:
  679. X!  * 12. PrintMsg:
  680. X!  * 13. SetAliases:
  681. X!  * 14. SetCursor:
  682. X!  * 15. SetDirectory:
  683. X!  * 16. SetFolders:
  684. X!  * 17. SetHelp:
  685. X!  * 18. SetPopup: and
  686. X!  * 19. SetSelect.
  687. X   *
  688. X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  689. X   *
  690. X--- 38,66 ----
  691. X   * The following software modules were created and are Copyrighted by National
  692. X   * Semiconductor Corporation:
  693. X   *
  694. X!  *  1. CheckInsert
  695. X!  *  2. DeleteChar
  696. X!  *  3. EraseIt:
  697. X!  *  4. DoAutograph:
  698. X!  *  5. DoCmd:
  699. X!  *  6. DoDone:
  700. X!  *  7. DoNothing:
  701. X!  *  8. DoReply:
  702. X!  *  9. DoSave:
  703. X!  * 10. DoSelected:
  704. X!  * 11. Folder:
  705. X!  * 12. Iconify:
  706. X!  * 13. MyNotify:
  707. X!  * 14. NextField:
  708. X!  * 15. PrintMsg:
  709. X!  * 16. SetAliases:
  710. X!  * 17. SetCursor:
  711. X!  * 18. SetDirectory:
  712. X!  * 19. SetFolders:
  713. X!  * 20. SetHelp:
  714. X!  * 21. SetMenu:
  715. X!  * 22. SetPopup: and
  716. X!  * 23. SetSelect.
  717. X   *
  718. X   * Author:  Michael C. Wagnitz - National Semiconductor Corporation
  719. X   *
  720. X***************
  721. X*** 74,102 ****
  722. X  
  723. X  
  724. X  /*
  725. X! ** @(#)DeleteLine() - Deletes the entire current line from the fileWindow.
  726. X! **                    Simulates the action of the KILL character (ctrl-U).
  727. X  */
  728. X  /* ARGSUSED */
  729. X  XtActionProc
  730. X! DeleteLine(w, event, params, num_params)
  731. X  Widget w;
  732. X  XEvent *event;
  733. X  String *params;
  734. X  Cardinal *num_params;
  735. X  {
  736. X!  XtTextBlock        textblock;
  737. X!  XtTextPosition     lastPos;
  738. X!  Cardinal         i;
  739. X  
  740. X!  lastPos = TextGetLastPos(w);
  741. X   textblock.firstPos = 0;
  742. X   textblock.length   = 0;
  743. X   textblock.ptr      = "";
  744. X  
  745. X!  for (i = lastPos; i > StartPos && FileBuf[i - 1] != '\n'; i--);
  746. X!  XtTextReplace(w, i, lastPos, &textblock);
  747. X!  Normalize(w);
  748. X  } /* DeleteLine */
  749. X  
  750. X  
  751. X--- 78,174 ----
  752. X  
  753. X  
  754. X  /*
  755. X! ** @(#)CheckInsert() - prevents the user from munging up the File: prompt.
  756. X! ** If the current insertion point is less than the minimum StartPos, move
  757. X! ** the insertion point to the StartPos.
  758. X  */
  759. X  /* ARGSUSED */
  760. X  XtActionProc
  761. X! CheckInsert(w, event, params, num_params)
  762. X  Widget w;
  763. X  XEvent *event;
  764. X  String *params;
  765. X  Cardinal *num_params;
  766. X  {
  767. X!  if (XtTextGetInsertionPoint(w) < StartPos)
  768. X!      XtTextSetInsertionPoint(w, StartPos);
  769. X! } /* CheckInsert */
  770. X  
  771. X! 
  772. X! /*
  773. X! ** @(#)EraseIt() - Delete the specified portion of text and force remaining
  774. X! ** text to be visible.  The second step is a hack for beginning-of-line(),
  775. X! ** end-of-line() actions in the text widget, because we want to ensure the
  776. X! ** insertion pointer stays where we wanted it.
  777. X! */
  778. X! void
  779. X! EraseIt(w, i, pos)
  780. X! Widget    w;
  781. X! XtTextPosition    i, pos;
  782. X! {
  783. X!  XtTextBlock    textblock;
  784. X! 
  785. X   textblock.firstPos = 0;
  786. X   textblock.length   = 0;
  787. X   textblock.ptr      = "";
  788. X  
  789. X!  XtTextReplace(w, i, pos, &textblock);
  790. X! 
  791. X!  if (i > StartPos + 40) {            /* ensure text is visible */
  792. X!     pos = i - 10;
  793. X!     XtTextSetInsertionPoint(w, pos);
  794. X!     XtTextSetInsertionPoint(w, TextGetLastPos(w));
  795. X!    }
  796. X! 
  797. X!  XtTextSetInsertionPoint(w, i);
  798. X! } /* EraseIt */
  799. X! 
  800. X! 
  801. X! /*
  802. X! ** @(#)DeleteChar() - prevents the user from deleting past the File: prompt.
  803. X! ** If the current insertion point is greater than the minimum StartPos, then
  804. X! ** delete the previous character.
  805. X! */
  806. X! /* ARGSUSED */
  807. X! XtActionProc
  808. X! DeleteChar(w, event, params, num_params)
  809. X! Widget w;
  810. X! XEvent *event;
  811. X! String *params;
  812. X! Cardinal *num_params;
  813. X! {
  814. X!  XtTextBlock    textblock;
  815. X!  XtTextPosition pos, i;
  816. X! 
  817. X!  pos = XtTextGetInsertionPoint(w);
  818. X!  if (pos > StartPos) {
  819. X!     i = pos - 1;
  820. X!     EraseIt(w, i, pos);
  821. X!    }
  822. X! } /* DeleteChar */
  823. X! 
  824. X! 
  825. X! /*
  826. X! ** @(#)DeleteLine() - Deletes the entire current line from the file window.
  827. X! **                    Simulates the action of the KILL character (ctrl-U).
  828. X! */
  829. X! /* ARGSUSED */
  830. X! XtActionProc
  831. X! DeleteLine(w, event, params, num_params)
  832. X! Widget w;
  833. X! XEvent *event;
  834. X! String *params;
  835. X! Cardinal *num_params;
  836. X! {
  837. X!  XtTextPosition pos, i;
  838. X! 
  839. X! 
  840. X!  pos = XtTextGetInsertionPoint(w);
  841. X!  if (pos > StartPos) {
  842. X!     for (i = pos; i > StartPos && FileBuf[i - 1] != '\n'; i--);
  843. X! 
  844. X!     EraseIt(w, i, pos);
  845. X!    }
  846. X  } /* DeleteLine */
  847. X  
  848. X  
  849. X***************
  850. X*** 112,130 ****
  851. X  String *params;
  852. X  Cardinal *num_params;
  853. X  {
  854. X!  XtTextBlock        textblock;
  855. X!  XtTextPosition    lastPos;
  856. X!  Cardinal         i, j;
  857. X  
  858. X!  textblock.firstPos = 0;
  859. X!  textblock.length   = 0;
  860. X!  textblock.ptr      = "";
  861. X  
  862. X!  lastPos = TextGetLastPos(w); 
  863. X!  for (i = lastPos; i > StartPos && FileBuf[i - 1] == ' '; i--);
  864. X!  for (j = i; i > StartPos && FileBuf[i - 1] != ' '; i--);
  865. X!  XtTextReplace(w, i, lastPos, &textblock);
  866. X!  Normalize(w);
  867. X  } /* DeleteWord */
  868. X  
  869. X  
  870. X--- 184,198 ----
  871. X  String *params;
  872. X  Cardinal *num_params;
  873. X  {
  874. X!  XtTextPosition    pos, i;
  875. X  
  876. X!  pos = XtTextGetInsertionPoint(w);
  877. X!  if (pos > StartPos) {
  878. X!     for (i = pos; i > StartPos && FileBuf[i - 1] == ' '; i--);
  879. X!     for (; i > StartPos && FileBuf[i - 1] != ' '; i--);
  880. X  
  881. X!     EraseIt(w, i, pos);
  882. X!    }
  883. X  } /* DeleteWord */
  884. X  
  885. X  
  886. X***************
  887. X*** 170,182 ****
  888. X   else if (strcmp(Command, "file %\n") != 0)
  889. X           Bell("No mail\n");        /* If not 'new mail', complain */
  890. X        else {
  891. X!          for (n = 0; n < mailargc; n++) {
  892. X!              if (strcmp(mailargv[n], "-f") == 0) {
  893. X!                 for (i = n + 2; i <= mailargc;) mailargv[n++] = mailargv[i++];
  894. X!                 mailargc -= 2;        /* throw away an folder argument */
  895. X!                 n -= 2;            /* re-examine new mailargv value */
  896. X!                }
  897. X!             }
  898. X           callMail(mailargc, mailargv);    /* restart the mail connections */
  899. X           strcpy(Command, "Start");    /* Let em know we've re-started */
  900. X           UnsetNewmail(w, NULL, NULL);
  901. X--- 238,247 ----
  902. X   else if (strcmp(Command, "file %\n") != 0)
  903. X           Bell("No mail\n");        /* If not 'new mail', complain */
  904. X        else {
  905. X!          if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
  906. X!             mailargc -= 2;        /* throw away any folder argument */
  907. X!             mailargv[mailargc] = NULL;    /* and NULL end of argument list */
  908. X!            }
  909. X           callMail(mailargc, mailargv);    /* restart the mail connections */
  910. X           strcpy(Command, "Start");    /* Let em know we've re-started */
  911. X           UnsetNewmail(w, NULL, NULL);
  912. X***************
  913. X*** 195,201 ****
  914. X  String        *params;
  915. X  Cardinal    *num_params;
  916. X  {
  917. X!  Done(w, *params, *params);
  918. X  } /* DoDone */
  919. X  
  920. X  
  921. X--- 260,266 ----
  922. X  String        *params;
  923. X  Cardinal    *num_params;
  924. X  {
  925. X!  Done(w, *params, NULL);
  926. X  } /* DoDone */
  927. X  
  928. X  
  929. X***************
  930. X*** 225,235 ****
  931. X  String *params;
  932. X  Cardinal *num_params;
  933. X  {
  934. X!  caddr_t    client_data;
  935. X!  caddr_t    call_data;
  936. X! 
  937. X!  client_data = params[0];
  938. X!  Reply(w, client_data, call_data);
  939. X  } /* DoReply */
  940. X  
  941. X  
  942. X--- 290,296 ----
  943. X  String *params;
  944. X  Cardinal *num_params;
  945. X  {
  946. X!  Reply(w, *params, NULL);
  947. X  } /* DoReply */
  948. X  
  949. X  
  950. X***************
  951. X*** 244,254 ****
  952. X  String        *params;
  953. X  Cardinal    *num_params;
  954. X  {
  955. X!  caddr_t    client_data;
  956. X!  caddr_t    call_data;
  957. X! 
  958. X!  client_data = params[0];
  959. X!  Save(w, client_data, call_data);
  960. X  } /* DoSave */
  961. X  
  962. X  
  963. X--- 305,311 ----
  964. X  String        *params;
  965. X  Cardinal    *num_params;
  966. X  {
  967. X!  Save(w, *params, NULL);
  968. X  } /* DoSave */
  969. X  
  970. X  
  971. X***************
  972. X*** 264,270 ****
  973. X  Cardinal *num_params;
  974. X  {
  975. X   XtTextPosition    pos;
  976. X!  int        num;
  977. X  
  978. X  
  979. X   if (! mailpid)
  980. X--- 321,328 ----
  981. X  Cardinal *num_params;
  982. X  {
  983. X   XtTextPosition    pos;
  984. X!  Widget        iw = WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow");
  985. X!  int        num = 0;
  986. X  
  987. X  
  988. X   if (! mailpid)
  989. X***************
  990. X*** 271,281 ****
  991. X      Bell("No mail\n");
  992. X   else {
  993. X      if (num_params) {
  994. X!        pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel, "vpane"), "indexWindow"));
  995. X!        num = PositionToMsgNumber(pos);    /* no current message returns zero */
  996. X!        if (num &&
  997. X!            *params[0] != 'n' && *params[0] != '-' && *params[0] != 'u')
  998. X!           sprintf(Command, "%s %d\n", params[0], num);
  999. X         else sprintf(Command, "%s\n", params[0]);
  1000. X         writeMail(Command);
  1001. X        }
  1002. X--- 329,340 ----
  1003. X      Bell("No mail\n");
  1004. X   else {
  1005. X      if (num_params) {
  1006. X!        if (*params[0] != 'n' && *params[0] != '-') {
  1007. X!           pos = XtTextGetInsertionPoint(iw);
  1008. X!           num = PositionToMsgNumber(pos);    /* no current msg equals zero */
  1009. X!           if (num && *params[0] == 'u' && IndexBuf[pos + 1] != 'D') num = 0;
  1010. X!          }
  1011. X!        if (num) sprintf(Command, "%s %d\n", params[0], num);
  1012. X         else sprintf(Command, "%s\n", params[0]);
  1013. X         writeMail(Command);
  1014. X        }
  1015. X***************
  1016. X*** 298,304 ****
  1017. X   char        *p;
  1018. X   Cardinal    n;
  1019. X  
  1020. X!  pos = TextGetLastPos(WidgetOf(WidgetOf(WidgetOf(toplevel, "vpane"), "commandPanel"), "fileWindow"));
  1021. X   if ((n = pos - StartPos) <= 0)
  1022. X      Bell("Specify a folder name (in the [File: ] box) first\n");
  1023. X   else {
  1024. X--- 357,363 ----
  1025. X   char        *p;
  1026. X   Cardinal    n;
  1027. X  
  1028. X!  pos = TextGetLastPos(WidgetOf(WidgetOf(WidgetOf(toplevel, "topBox"), "commandPanel"), "fileWindow"));
  1029. X   if ((n = pos - StartPos) <= 0)
  1030. X      Bell("Specify a folder name (in the [File: ] box) first\n");
  1031. X   else {
  1032. X***************
  1033. X*** 313,326 ****
  1034. X  ** This time, we indicate a specific mail folder to process.
  1035. X  */
  1036. X         XMail.MFileName = XtNewString(p);
  1037. X!        for (n = 0; n < mailargc; n++)
  1038. X!            if (strcmp(mailargv[n], "-f") == 0) {
  1039. X!               mailargv[++n] = XMail.MFileName;
  1040. X!               break;
  1041. X!              }
  1042. X!        if (n == mailargc) {        /* if not previously specified */
  1043. X            mailargv[mailargc++] = "-f";
  1044. X            mailargv[mailargc++] = XMail.MFileName;
  1045. X           }
  1046. X         callMail(mailargc, mailargv);
  1047. X         strcpy(Command, "Start");    /* Let em know we've re-started */
  1048. X--- 372,383 ----
  1049. X  ** This time, we indicate a specific mail folder to process.
  1050. X  */
  1051. X         XMail.MFileName = XtNewString(p);
  1052. X!        if (strcmp(mailargv[mailargc - 2], "-f") == 0) {
  1053. X!           mailargv[mailargc - 1] = XMail.MFileName;
  1054. X!          } else {
  1055. X            mailargv[mailargc++] = "-f";
  1056. X            mailargv[mailargc++] = XMail.MFileName;
  1057. X+           mailargv[mailargc] = NULL;    /* list MUST be NULL terminated */
  1058. X           }
  1059. X         callMail(mailargc, mailargv);
  1060. X         strcpy(Command, "Start");    /* Let em know we've re-started */
  1061. X***************
  1062. X*** 329,362 ****
  1063. X  } /* Folder */
  1064. X  
  1065. X  
  1066. X- /*
  1067. X- ** @(#)InsertSpace() - prevents user from deleting past the File: prompt.
  1068. X- ** It checks the last position of text, and if it matches StartPos, inserts
  1069. X- ** a space so that delete-previous-character() can only delete the space.
  1070. X- */
  1071. X  /* ARGSUSED */
  1072. X- XtActionProc
  1073. X- InsertSpace(w, event, params, num_params)
  1074. X- Widget w;
  1075. X- XEvent *event;
  1076. X- String *params;
  1077. X- Cardinal *num_params;
  1078. X- {
  1079. X-  XtTextBlock    textblock;
  1080. X-  XtTextPosition lastPos;
  1081. X- 
  1082. X-  lastPos = TextGetLastPos(w);
  1083. X-  XtTextSetInsertionPoint(w, lastPos);
  1084. X-  if (lastPos == StartPos) {
  1085. X-     textblock.firstPos = 0;
  1086. X-     textblock.length   = 1;
  1087. X-     textblock.ptr      = " ";
  1088. X-     XtTextReplace(w, lastPos, lastPos, &textblock);
  1089. X-    }
  1090. X- } /* InsertSpace */
  1091. X- 
  1092. X- 
  1093. X- /* ARGSUSED */
  1094. X  /*
  1095. X  ** @(#)Iconify() - request window iconification
  1096. X  */
  1097. X--- 386,392 ----
  1098. X***************
  1099. X*** 367,373 ****
  1100. X  String *params;
  1101. X  Cardinal *num_params;
  1102. X  {
  1103. X! #ifndef X11R3
  1104. X   Display        *disp;
  1105. X  
  1106. X   disp = XtDisplay(toplevel);
  1107. X--- 397,403 ----
  1108. X  String *params;
  1109. X  Cardinal *num_params;
  1110. X  {
  1111. X! #if XtSpecificationRelease >= 4
  1112. X   Display        *disp;
  1113. X  
  1114. X   disp = XtDisplay(toplevel);
  1115. X***************
  1116. X*** 410,415 ****
  1117. X--- 440,447 ----
  1118. X  
  1119. X  
  1120. X   if (strcmp(w->core.name, "Cc") == 0)
  1121. X+     name = "Bcc"; else
  1122. X+  if (strcmp(w->core.name, "Bcc") == 0)
  1123. X      name = "To"; else
  1124. X   if (strcmp(w->core.name, "To") == 0)
  1125. X      name = "Subject"; else
  1126. X***************
  1127. X*** 433,451 ****
  1128. X  Cardinal *num_params;
  1129. X  {
  1130. X   XtTextPosition    pos;
  1131. X   int        num;
  1132. X  
  1133. X   if (! mailpid)
  1134. X      Bell("No mail\n");
  1135. X   else {
  1136. X!     pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel, "vpane"), "indexWindow"));
  1137. X      num = PositionToMsgNumber(pos);    /* no current message returns zero */
  1138. X      if (! num) Bell("No messages to print.\n");
  1139. X      else {
  1140. X!        sprintf(Command, "| %d \"lpr -p\"\n", num);
  1141. X!     writeMail(Command);
  1142. X     }
  1143. X-    }
  1144. X  } /* PrintMsg */
  1145. X  
  1146. X  
  1147. X--- 465,490 ----
  1148. X  Cardinal *num_params;
  1149. X  {
  1150. X   XtTextPosition    pos;
  1151. X+  char        *cp;
  1152. X   int        num;
  1153. X  
  1154. X   if (! mailpid)
  1155. X      Bell("No mail\n");
  1156. X   else {
  1157. X!     pos = XtTextGetInsertionPoint(WidgetOf(WidgetOf(toplevel, "topBox"), "indexWindow"));
  1158. X      num = PositionToMsgNumber(pos);    /* no current message returns zero */
  1159. X      if (! num) Bell("No messages to print.\n");
  1160. X      else {
  1161. X!        cp = GetMailEnv("printmail");
  1162. X!        if (! cp) {
  1163. X!           sprintf(Command, "| %d \"lpr -p\"\n", num);
  1164. X!          } else {
  1165. X!           sprintf(Command, "| %d \"%s\"\n", num, cp);
  1166. X!           XtFree(cp);
  1167. X!          }
  1168. X!        writeMail(Command);
  1169. X!       }
  1170. X     }
  1171. X  } /* PrintMsg */
  1172. X  
  1173. X  
  1174. X***************
  1175. X*** 460,467 ****
  1176. X  String        *params;
  1177. X  Cardinal    *num_params;
  1178. X  {
  1179. X!  Arg        args[MAXARGS];
  1180. X!  Cardinal    i, j, k, n, x, y;
  1181. X   Display        *ad;
  1182. X   Widget        bw, lw, popup, hold, left;
  1183. X   Window         aw, dumy, root;
  1184. X--- 499,507 ----
  1185. X  String        *params;
  1186. X  Cardinal    *num_params;
  1187. X  {
  1188. X!  Arg        args[8];
  1189. X!  Cardinal    i, j, k;
  1190. X!  int        n, x, y;
  1191. X   Display        *ad;
  1192. X   Widget        bw, lw, popup, hold, left;
  1193. X   Window         aw, dumy, root;
  1194. X***************
  1195. X*** 505,511 ****
  1196. X  ** Make equal width command buttons which contain the alias names
  1197. X  */
  1198. X         XtSetArg(args[0], XtNdefaultDistance, 1);
  1199. X!        lw = XtCreateManagedWidget("list", formWidgetClass, popup, args, ONE);
  1200. X  
  1201. X         bw = left = NULL;
  1202. X         XtSetArg(args[0], XtNwidth, XTextWidth(TextFontStr, aliases[i]->name, j) + 14);
  1203. X--- 545,551 ----
  1204. X  ** Make equal width command buttons which contain the alias names
  1205. X  */
  1206. X         XtSetArg(args[0], XtNdefaultDistance, 1);
  1207. X!        lw = XtCreateManagedWidget("table", formWidgetClass, popup, args, ONE);
  1208. X  
  1209. X         bw = left = NULL;
  1210. X         XtSetArg(args[0], XtNwidth, XTextWidth(TextFontStr, aliases[i]->name, j) + 14);
  1211. X***************
  1212. X*** 515,526 ****
  1213. X  
  1214. X         i = j = 0;
  1215. X         if (n > 10) {            /* If more than ten aliases try to */
  1216. X!           j = (int) sqrt((double)n);    /* make list approximately square. */
  1217. X!           i = (int) n / j;
  1218. X!           if (i * j < n) i++;
  1219. X!           if (j > 3) i++;
  1220. X!           if (j > 4) i++;
  1221. X!           if (j > 5) i = 21;        /* try to keep box inside main shell */
  1222. X           }
  1223. X  
  1224. X         for (n = 0; aliases[n]; n++) {
  1225. X--- 555,568 ----
  1226. X  
  1227. X         i = j = 0;
  1228. X         if (n > 10) {            /* If more than ten aliases try to */
  1229. X!           j = n / 4;            /* make list approximately square. */
  1230. X!           while (j * j < n) j++;    /* (int. hack to replace sqrt usage) */
  1231. X!           i = n / --j;
  1232. X!           while (i * j < n) i++;
  1233. X!           while (j > 3 && i < 25) {    /* try to keep box inside main shell */
  1234. X!                 i++;
  1235. X!                 j--;
  1236. X!                }
  1237. X           }
  1238. X  
  1239. X         for (n = 0; aliases[n]; n++) {
  1240. X***************
  1241. X*** 527,533 ****
  1242. X             XtSetArg(args[4], XtNlabel, aliases[n]->name);
  1243. X             XtSetArg(args[5], XtNfromHoriz, left);
  1244. X             XtSetArg(args[6], XtNfromVert, bw);
  1245. X!            bw = XtCreateManagedWidget("button",commandWidgetClass,lw,args,7);
  1246. X  
  1247. X             if (i) {            /* post names in a rectangular list */
  1248. X                if (n % i == 0) hold = bw;
  1249. X--- 569,575 ----
  1250. X             XtSetArg(args[4], XtNlabel, aliases[n]->name);
  1251. X             XtSetArg(args[5], XtNfromHoriz, left);
  1252. X             XtSetArg(args[6], XtNfromVert, bw);
  1253. X!            bw = XtCreateManagedWidget("entry", commandWidgetClass, lw, args, 7);
  1254. X  
  1255. X             if (i) {            /* post names in a rectangular list */
  1256. X                if (n % i == 0) hold = bw;
  1257. X***************
  1258. X*** 578,584 ****
  1259. X  
  1260. X   XDefineCursor(XtDisplay(w), XtWindow(w), tmpC);
  1261. X  
  1262. X!  if (*num_params == 1)            /* flush output if only one parameter */
  1263. X      XFlush(XtDisplay(toplevel));
  1264. X  } /* SetCursor */
  1265. X  
  1266. X--- 620,626 ----
  1267. X  
  1268. X   XDefineCursor(XtDisplay(w), XtWindow(w), tmpC);
  1269. X  
  1270. X!  if (*num_params)            /* flush output if parameterized */
  1271. X      XFlush(XtDisplay(toplevel));
  1272. X  } /* SetCursor */
  1273. X  
  1274. X***************
  1275. X*** 594,608 ****
  1276. X  String        *params;
  1277. X  Cardinal    *num_params;
  1278. X  {
  1279. X!  Arg        args[MAXARGS];
  1280. X   Display        *ad;
  1281. X   Window         aw, dumy, root;
  1282. X   Widget        lw, above, this_one, to_left, popup;
  1283. X!  Cardinal    x, y, n;
  1284. X   char        trans[BUFSIZ], tmp[BUFSIZ], *p, *List = NULL;
  1285. X   char        foldir[BUFSIZ], *GetMailEnv(), *getenv();
  1286. X   int        foldlen, List_size, newline = 0;
  1287. X!  DIR        *dirp;
  1288. X  
  1289. X  #ifdef SUNOS_4
  1290. X   struct dirent    *dp;
  1291. X--- 636,650 ----
  1292. X  String        *params;
  1293. X  Cardinal    *num_params;
  1294. X  {
  1295. X!  Arg        args[8];
  1296. X   Display        *ad;
  1297. X   Window         aw, dumy, root;
  1298. X   Widget        lw, above, this_one, to_left, popup;
  1299. X!  int        x, y, n;
  1300. X   char        trans[BUFSIZ], tmp[BUFSIZ], *p, *List = NULL;
  1301. X   char        foldir[BUFSIZ], *GetMailEnv(), *getenv();
  1302. X   int        foldlen, List_size, newline = 0;
  1303. X!  DIR        *dirp = NULL;
  1304. X  
  1305. X  #ifdef SUNOS_4
  1306. X   struct dirent    *dp;
  1307. X***************
  1308. X*** 629,686 ****
  1309. X   popup = XtNameToWidget(w, "popupList");
  1310. X  
  1311. X   if (! popup || popup->core.being_destroyed) {
  1312. X!     p = GetMailEnv("folder");
  1313. X      if (p && strlen(p)) {
  1314. X         sprintf(foldir, "%s/%s/", getenv("HOME"), p);
  1315. X!        XtFree(p);
  1316. X!       } else sprintf(foldir, "%s/", getenv("HOME"));
  1317. X      foldlen = strlen(foldir);
  1318. X  
  1319. X      XtSetArg(args[0], XtNtranslations, XtParseTranslationTable(l_Trans));
  1320. X      popup = XtCreatePopupShell("popupList",overrideShellWidgetClass,w,args,1);
  1321. X  
  1322. X!     if (mailpid)
  1323. X!        List = QueryMail("folders");
  1324. X!     else {
  1325. X!        if ((dirp = opendir(foldir)) == NULL)
  1326. X!           XtError("SetFolder: Can't access mail folder directory");
  1327. X! /*
  1328. X! ** allocate one block to 'List' to begin with
  1329. X! */
  1330. X!        List_size = BUFSIZ;
  1331. X!        List = XtMalloc(List_size);
  1332. X!        strcpy(List, "");
  1333. X!        x = 0;
  1334. X!        for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
  1335. X!            if (strcmp(dp->d_name, ".") && strcmp(dp->d_name, "..")) {
  1336. X!               if (strlen(List) + strlen(dp->d_name) + 2 > List_size) {
  1337. X!                  List_size += BUFSIZ;
  1338. X!                  List = XtRealloc(List, List_size);
  1339. X!                 }
  1340. X!               strcat(List, " ");
  1341. X!               strcat(List, dp->d_name);
  1342. X!               if (++x % 6 == 0) {
  1343. X!                  x = 0;
  1344. X!                  strcat(List, "\n");
  1345. X!                 }
  1346. X!              }
  1347. X!        List = XtRealloc(List, strlen(List) + 1);
  1348. X!        closedir(dirp);
  1349. X!       }
  1350. X  /*
  1351. X  ** determine proper label width by finding longest word length
  1352. X  */
  1353. X      strcpy(trans, "");
  1354. X!     for (x = 0, p = List; *p; p++) {
  1355. X!         if (*p == ' ' || *p == '\n' || *p == '\t') {
  1356. X!            if (x) {
  1357. X!               tmp[x] = '\0';
  1358. X!               x = 0;
  1359. X!               if (strlen(trans) < strlen(tmp))
  1360. X!                  strcpy(trans, tmp);
  1361. X!              }
  1362. X!           } else tmp[x++] = *p;
  1363. X!        }
  1364. X  
  1365. X      if (x) {
  1366. X         tmp[x] = '\0';
  1367. X--- 671,730 ----
  1368. X   popup = XtNameToWidget(w, "popupList");
  1369. X  
  1370. X   if (! popup || popup->core.being_destroyed) {
  1371. X!     p = GetMailEnv("folder");            /* returns NULL if none */
  1372. X      if (p && strlen(p)) {
  1373. X         sprintf(foldir, "%s/%s/", getenv("HOME"), p);
  1374. X!        XtFree((char *)p);            /* p still has an address */
  1375. X!       } else
  1376. X!        strcpy(foldir, "");    /* If no folder variable, then no folders */
  1377. X      foldlen = strlen(foldir);
  1378. X  
  1379. X      XtSetArg(args[0], XtNtranslations, XtParseTranslationTable(l_Trans));
  1380. X      popup = XtCreatePopupShell("popupList",overrideShellWidgetClass,w,args,1);
  1381. X  
  1382. X!     if (*foldir) {                /* if folder variable exists */
  1383. X!        if (mailpid)
  1384. X!           List = QueryMail("folders");
  1385. X!        else {
  1386. X!           if (dirp = opendir(foldir)) {        /* and folder is readable... */
  1387. X!              List_size = BUFSIZ;
  1388. X!              List = XtMalloc(List_size);    /* start with a BUFSIZ block */
  1389. X!              strcpy(List, "");
  1390. X!              x = 0;
  1391. X!              for (dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
  1392. X!                  if (strcmp(dp->d_name, ".") && strcmp(dp->d_name, "..")) {
  1393. X!                     if (strlen(List) + strlen(dp->d_name) + 2 > List_size) {
  1394. X!                        List_size += BUFSIZ;
  1395. X!                        List = XtRealloc(List, List_size);
  1396. X!                       }
  1397. X!                     strcat(List, " ");
  1398. X!                     strcat(List, dp->d_name);
  1399. X!                     if (++x % 6 == 0) {
  1400. X!                        x = 0;
  1401. X!                        strcat(List, "\n");
  1402. X!                       }
  1403. X!                    }
  1404. X!              List = XtRealloc(List, strlen(List) + 1);
  1405. X!              closedir(dirp);
  1406. X!             } /* end - if folder directory is readable */
  1407. X!          } /* end - if mail process is running */
  1408. X!       } /* end - if a folder value exists */
  1409. X  /*
  1410. X  ** determine proper label width by finding longest word length
  1411. X  */
  1412. X      strcpy(trans, "");
  1413. X!     x = 0;
  1414. X!     if (p)                /* if folders exist and are readable */
  1415. X!        for (p = List; *p; p++) {
  1416. X!            if (*p == ' ' || *p == '\n' || *p == '\t') {
  1417. X!               if (x) {
  1418. X!                  tmp[x] = '\0';
  1419. X!                  x = 0;
  1420. X!                  if (strlen(trans) < strlen(tmp))
  1421. X!                     strcpy(trans, tmp);
  1422. X!                 }
  1423. X!              } else tmp[x++] = *p;
  1424. X!           }
  1425. X  
  1426. X      if (x) {
  1427. X         tmp[x] = '\0';
  1428. X***************
  1429. X*** 688,698 ****
  1430. X            strcpy(trans, tmp);
  1431. X        }
  1432. X  
  1433. X!     if ((n = strlen(trans)) == 0) {    /* if there are no mail folders */
  1434. X!        n = 0;                    /* set a dummy width and */
  1435. X!        XtSetArg(args[n], XtNwidth, 1); n++;    /* height so MenuPopup() */
  1436. X!        XtSetArg(args[n], XtNheight, 1); n++;    /* won't complain about */
  1437. X!        XtSetValues(popup, (ArgList) args, n);    /* zero width or height */
  1438. X  
  1439. X         XtDestroyWidget(popup);    /* it would be nice if MenuPopup() cared */
  1440. X        } else {
  1441. X--- 732,741 ----
  1442. X            strcpy(trans, tmp);
  1443. X        }
  1444. X  
  1445. X!     if ((n = strlen(trans)) == 0) {    /* if no folders set dummy width and */
  1446. X!        XtSetArg(args[0], XtNwidth, 1);        /* height so MenuPopup() */
  1447. X!        XtSetArg(args[1], XtNheight, 1);        /* won't complain about */
  1448. X!        XtSetValues(popup, (ArgList) args, 2);    /* zero width or height */
  1449. X  
  1450. X         XtDestroyWidget(popup);    /* it would be nice if MenuPopup() cared */
  1451. X        } else {
  1452. X***************
  1453. X*** 723,731 ****
  1454. X                      tmp[x++] = '/';
  1455. X                      tmp[x] = '\0';
  1456. X                     }
  1457. X!                  n = 4;
  1458. X!                  XtSetArg(args[n], XtNlabel, tmp);            n++;
  1459. X!                  XtSetArg(args[n], XtNfromHoriz, to_left);        n++;
  1460. X                   if (! to_left) XtSetArg(args[n], XtNfromVert, above);    n++;
  1461. X     
  1462. X                   this_one = XtCreateManagedWidget("listbutton", commandWidgetClass,
  1463. X--- 766,773 ----
  1464. X                      tmp[x++] = '/';
  1465. X                      tmp[x] = '\0';
  1466. X                     }
  1467. X!                  XtSetArg(args[4], XtNlabel, tmp);
  1468. X!                  XtSetArg(args[5], XtNfromHoriz, to_left);        n = 6;
  1469. X                   if (! to_left) XtSetArg(args[n], XtNfromVert, above);    n++;
  1470. X     
  1471. X                   this_one = XtCreateManagedWidget("listbutton", commandWidgetClass,
  1472. X***************
  1473. X*** 749,785 ****
  1474. X               } else {
  1475. X                 if (x == 0) tmp[x++] = '+';    /* start folder names with a 'plus' */
  1476. X                 tmp[x++] = *p;
  1477. X            }
  1478. X-        }
  1479. X  
  1480. X!     if (x) {
  1481. END_OF_FILE
  1482. if test 48483 -ne `wc -c <'Patch.01a'`; then
  1483.     echo shar: \"'Patch.01a'\" unpacked with wrong size!
  1484. fi
  1485. # end of 'Patch.01a'
  1486. fi
  1487. echo shar: End of archive 2 \(of 5\).
  1488. cp /dev/null ark2isdone
  1489. MISSING=""
  1490. for I in 1 2 3 4 5 ; do
  1491.     if test ! -f ark${I}isdone ; then
  1492.     MISSING="${MISSING} ${I}"
  1493.     fi
  1494. done
  1495. if test "${MISSING}" = "" ; then
  1496.     echo You have unpacked all 5 archives.
  1497.     rm -f ark[1-9]isdone
  1498. else
  1499.     echo You still need to unpack the following archives:
  1500.     echo "        " ${MISSING}
  1501. fi
  1502. ##  End of shell archive.
  1503. exit 0
  1504.  
  1505. dan
  1506. ----------------------------------------------------
  1507. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1508. Opinions expressed reflect those of the author only.
  1509.